package org.vectrics.recruiter.struts.tag;

import org.vectrics.common.struts.*;
import org.vectrics.skill.Skill;
import org.apache.log4j.Category;
import org.vectrics.web.menu.Menu;

public class UserMenuTag extends MenuTag {

	private static final long serialVersionUID = 5699335563221398044L;
	
	private static Category log = Category.getInstance(UserMenuTag.class);
    //private UserProfile userProfile = null;
    public static String ENTRY_TYPE_PARAM = "entry_type";
    Skill rootSkill = null;
    boolean forceAllChildrenToDisplay = false;
    public static String SUB_MENU_CAPTION_PROPERTY = "sub_menu_caption";

    
    public String getMenuId() {
    	return("SUB");
    }
    
	public void buildMenu(Menu menu) {
		String formPath = getFormPath();
		if (formPath.indexOf("public/31100001/credentials/") >= 0) {
			menu.addItem("summary", "My Profile", getContextPath() + "/profile/31100001/summary.do"); 
			menu.addItem("logoff", "Log Off", getContextPath() + "/public/31100001/logoff.do"); 
		}
		else {
			log.debug("not a credentials sub-menu");
		}
		
    }

	public String getSelected() {
		String formPath = getFormPath();
		String select = "";
		log.info("getSelected() - formPath = " + formPath);
		
		if (formPath.indexOf("/summary.do") >= 0) {
			select = "summary";
		}
		else if (formPath.indexOf("/edit_resume.do") >= 0) {
			select = "resume";
		}
		
		return(select);
	}




}